//
//  CommentCell.m
//  Dear
//
//  Created by n22 on 15/7/15.
//  Copyright (c) 2015年 陈俊俊. All rights reserved.
//

#import "CommentCell.h"
#import "UIImageView+WebCache.h"
@implementation CommentCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setCommentModel:(CommentModel *)commentModel{
    if (commentModel.picture.length > 0) {
        NSArray *pictures = [commentModel.picture componentsSeparatedByString:@","];
        NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@?path=%@",ServerUrl,DearImage,pictures[0]]];
        [self.cheadImageV sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"logobg"]];
    }
    
    self.ctitleLabel.text = commentModel.userName;
    self.dateLabel.text = [CJJHelper dateStringFormNumberString:commentModel.dt_create];
    self.ccontentLabel.numberOfLines = 0;
    self.ccontentLabel.text = commentModel.content;
    CGFloat conH = 0;
    if (commentModel.content.length > 0) {
        conH = [CJJHelper textHeightFromString:commentModel.content width:ScreenSize.width - 20 fontSize:15];
    }
    self.ccontentH.constant = conH + 10;
    self.addressLabel.text = commentModel.address;
    [self layoutIfNeeded];

}


@end
